package com.qlk.odcinterface.dao.impl;

import com.qlk.common.dao.mybatis.BaseDao;
import com.qlk.odcinterface.dao.PmsFullCutDao;
import com.qlk.odcinterface.domain.PmsFullCut;
import com.qlk.odcinterface.domain.query.PmsFullCutQuery;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * PmsFullCutDAO实现类<br/>
 * 对'满减表'表进行基本的操作
 * 
 * @author zhaoyanan
 * @version 2016-4-14 16:23:00
 * 
 */
@Repository
public class PmsFullCutDaoImpl extends BaseDao implements PmsFullCutDao {
    /** namespace */
    private final String namespace = PmsFullCutDaoImpl.class.getName();
    
    /**
     * {@inheritDoc}
     */
    public List<PmsFullCut> queryPmsFullCutList(PmsFullCutQuery queryBean) {
        return (List<PmsFullCut>) queryForList(namespace +".queryPmsFullCutList", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean insert(PmsFullCut pmsFullCut) {
        return insert(namespace +".insert", pmsFullCut);
    }

    /**
     * {@inheritDoc}
     */
    public boolean update(PmsFullCut pmsFullCut) {
        return update(namespace +".update", pmsFullCut);
    }

    /**
     * {@inheritDoc}
     */
    public int queryPmsFullCutCount(PmsFullCutQuery queryBean) {
        return (Integer) queryForObject(namespace +".queryPmsFullCutCount", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public List<PmsFullCut> queryPmsFullCutListWithPage(PmsFullCutQuery queryBean) {
        return (List<PmsFullCut>) queryForList(namespace +".queryPmsFullCutListWithPage", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean delete(PmsFullCut configuration) {
        return delete(namespace +".delete", configuration);
    }

    /**
     * {@inheritDoc}
     */
    public PmsFullCut getPmsFullCutById(Long id) {
        return (PmsFullCut) queryForObject(namespace +".getPmsFullCutById", id);
    } 
    
    /**
     * {@inheritDoc}
     */
    public boolean exist(PmsFullCut pmsFullCut) {
        int count = (Integer) queryForObject(namespace +".exist", pmsFullCut);
        return count > 0;
    }
}
